package com.nuo.quartz.beans.pojo.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 任务日志响应
 *
 * @author LGC
 */
@ApiModel(value = "QuartzLogRespDTO", description = "任务日志响应")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class QuartzLogRespDTO implements Serializable {

    private static final long serialVersionUID = -3790393476851621263L;
    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "任务ID")
    private Integer jobId;

    @ApiModelProperty(value = "任务模式 1.bean模式  2.http模式")
    private Integer jobMode;

    @ApiModelProperty(value = "jobMode =1: 执行Bean名称,jobMode =2:调度接口地址，一般为开放接口")
    private String beanName;

    @ApiModelProperty(value = "执行参数，JSON字符串")
    private String params;

    @ApiModelProperty(value = "任务状态：1成功，2失败")
    private Integer state;

    @ApiModelProperty(value = "失败信息")
    private String error;

    @ApiModelProperty(value = "耗时(单位：毫秒)")
    private Integer times;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GTM+8")
    private Date createTime;
}
